// 请求接口
import { getList,deleteStore,addStore,getInfo,editStore} from '@/api/store'

const state = {}

const mutations = {}

const actions = {

  // 获取 仓库 列表信息
  async getList({commit},serchForm) {
    let res = await getList(serchForm);
    return res
  },
  // 删除仓库信息
  async deleteStore({},id) {
    let res = await deleteStore(id);
    return res
  },
  // 添加仓库信息
  async addStore({},storeForm) {
    const res = await addStore(storeForm);
    return res
  },
  // 获取单个仓库信息
  async getInfo({},id) {
    const res = await getInfo(id);
    return res
  },
  // 修改单个仓库信息
  async editStore({},storeInfo) {
    const res = await editStore(storeInfo.id,storeInfo);
    return res
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}

